<template>
  <header class="fxs" :class="[type == 3 ? 'order':'']">
    <div class="info-bg info" v-if="type != 3">
      <span class="commission fontGilroy">
        <!-- <i>¥</i> -->
        {{Data.total_commissions}}
      </span>
      <p>我的{{Data.commission_name}}（元）</p>
    </div>
    <div class="info-bg info2" v-else>
      <div class="commission fontGilroy">
        <span>
          <!-- <i>¥</i> -->
          {{Data.total_commissions}}
        </span>
        <p>我的{{Data.commission_name}}（元）</p>
      </div>
      <div class="other fontGilroy">
        <div>
          <span>{{Data.total_fee || 0}}</span>
          <p>{{Data.ftitle_fx_order}}总金额（元）</p>
        </div>
        <div>
          <span>{{Data.superior_user_payment || 0}}</span>
          <p>{{Data.ftitle_superior_user_order}}总金额（元）</p>
        </div>
      </div>
    </div>
    <nav>
      <div
        v-if="Data.show_fxProduct"
        class="nav-item"
        :class="[0 == type?'active':'']"
        @click="selectNav('staff-goods',0)"
      >
        <p class="num fontGilroy">{{Data.fenxiao_goods_count || 0}}</p>
        <p class="name">{{Data.ftitle_item}}</p>
        <i></i>
      </div>
      <div
        class="nav-item"
        :class="[1 == type?'active':'']"
        @click="selectNav('staff-level-agent',1)"
      >
        <p class="num fontGilroy">{{Data.next_lever_agent_count || 0}}</p>
        <p class="name">{{Data.ftitle_agents}}</p>
        <i></i>
      </div>
      <div
        v-if="Data.show_myUser"
        class="nav-item"
        :class="[2 == type?'active':'']"
        @click="selectNav('staff-level-user',2)"
      >
        <p class="num fontGilroy">{{Data.next_lever_user_count || 0}}</p>
        <p class="name">{{Data.ftitle_users}}</p>
        <i></i>
      </div>
      <div
        class="nav-item"
        v-if="Data.show_fxOrder"
        :class="[3 == type?'active':'']"
        @click="selectNav('staff-order',3)"
      >
        <p class="num fontGilroy">{{Data.fenxiao_order_count || 0}}</p>
        <p class="name">{{Data.ftitle_fx_order}}</p>
        <i></i>
      </div>
    </nav>
  </header>
</template>

<script>
  import Vue from 'vue'
  export default Vue.extend({
    props: {
      type: Number,
      Data: {
        type: Object
      }
    },
    methods: {
      Jump(url) {
        this.$JumpName(this, url)
      },
      selectNav(path,curtype) {
        if(curtype != this.type){
          this.$JumpPath(this,path)
        }
      }
    }
  })
</script>

<style lang="scss">
@import 'src/styles/variables';
@import 'src/styles/mixin';
header {
  position: relative;
  width: 100%;
  .info-bg{    
    // height: 210px;
    text-align: center;
    margin: 0 auto;
    padding:56px 0;
    color: $default;
    background: url('https://img.wifenxiao.com/h5-wfx/images/user/fenxiaoGood_bg.png') center
      no-repeat;
    background-size: 100% 100%;
  }
  .info {
    p {
      margin-top: 14px;
      font-size: 26px;
      color:#FFD9DD;
    }
    span {
      display: block;
      font-size: 50px;
      i {
        font-size: 24px;
        margin-right: -10px;
      }
    }
  }
  .info2 {
    padding:46px 0;
    .commission {
      p {
        font-size: 26px;
        margin-top: 14px;
        color:#FFD9DD;
      }
      span {
        display: block;
        font-size: 50px;
      }
    }
    .other {
      margin-top: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      >div {
        flex: 1;
        padding: 0 20px;
        position: relative;
        &:first-child{
          &::before {
            content:"";
            position: absolute;
            bottom: 0;
            right: 0;
            width: 1px;
            height: 70px;
            background-color:#ff7c86;
          }
        }
        p {
          font-size: 24px;
          color: #ffdcd8;
          margin-top: 14px;
        }
        span {
          display: block;
          font-weight: bold;
          font-size: 36px;
        }
      }
    }
  }
  nav {
    width: 100%;
    height: 138px;
    background-color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    // overflow: hidden;
    .nav-item {
      flex: 1;
      height: 100%;
      position: relative;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;

      p {
        text-align: center;
        &.num {
          font-size: 32px;
          color: #F30C23;
          font-weight: bold;
        }
        &.name {
          font-size: 24px;
          color: #666;
          margin-top: 10px;
        }
      }
      &.active i {
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        height: 6px;
        width: 96px;
        @include gradient(right, rgba(242,11,34,1),rgba(242,11,34,0.1));
      }
      &:last-child {
        &::after {
          border: none;
        }
      }
    }
  }
}
</style>
